package com.leo.tool.jsch;

import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;

public class JschTemplate {

    public static void main(String[] args) throws Exception {
        JSch jsch = new JSch();
        jsch.addIdentity("C:/Users/Leonhardt/.ssh/id_rsa");
        Session session = jsch.getSession("root", "47.103.14.69", 22);
        session.setConfig("StrictHostKeyChecking", "no");
        session.setTimeout(3000);
        session.connect();
        System.out.println("connect success!");
        System.exit(0);
    }

}
